package com.my.internetplus.controller;

import com.my.internetplus.model.User;
import com.my.internetplus.result.BaseResult;
import com.my.internetplus.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class LoginController {


    @Resource
    private UserService userService;

    //登录
    @RequestMapping("login")
    public BaseResult<User> login(String openid){
        User user = userService.selectUserByOpenId(openid);
        System.out.println(user);
        return BaseResult.success(user);
    }

}
